"""
CSV数据：所有数据以逗号分隔
"""

import csv  # 内置模块

ll = [
    [1, 2, 3, 4],
    [1, 2, 3, 4],
    [5, 6, 7, 8],
    [5, 6, 7, 8],
]

with open('data.csv', mode='a', encoding='utf-8', newline="") as f:
    """
    newline: 指定新行
    csv.writer(f)    CSV模块的写入对象，括号里面传递文件对象
    writerow(i)      整行写入数据，需要传递数据容器（列表、元组）
    """
    csv_write = csv.writer(f)
    for i in ll:
        csv_write.writerow(i)
